package a_02_wizhi.P_proxy.cglib;

import org.springframework.cglib.proxy.InvocationHandler;

import java.lang.reflect.Method;

/**
 * @author fanhb on 2017/9/2
 * @desc xxxx
 */
public class ProxyCglibHandler implements InvocationHandler {
    private Object target;
    public Object invoke(Object o, Method method, Object[] objects) throws Throwable {
        System.out.println("事务开始.......");
        System.out.println("ProxyCglib.invoke");
        Object invoke = method.invoke(target);
        System.out.println("事务提交.....end");
        return invoke;
    }

    public ProxyCglibHandler(Object target) {
        this.target = target;
    }

    private ProxyCglibHandler() {
        this.target = target;
    }

}
